#pragma once

#include "Includes.h"
#include "IConnection.h"
#include "BipBuffer.h"


class SerialConnection : public IConnection {
public:
    SerialConnection();
    void connect(std::string portname);
    static std::vector<std::string> getPorts();

    // IConnection
    void sendString(std::string message)	override;
    int read(char* buf, int bufSize)		override;
	void close()							override;
	std::string toString()				override;


private:
    HANDLE hComm;
    BipBuffer mBuffer;

	OVERLAPPED mOverlappedRead;
	OVERLAPPED mOverlappedWrite;

};